<?php 
/**
 * User: Administrator、
 * Date: 2017/8/5
 * Time: 10:57
 */
namespace app\home\controller;
use think\Controller;
use think\Db;
use app\home\model\ContentModel;
class Index extends Common
{
    private $AgencySiteInfo=array();
    private $Config=array();
	private $UrlParam=array();

    public function _initialize(){
        parent::_initialize();
		
		$this->ConModel = new ContentModel();
		$this->UrlParam=input();
		if(isset($this->UrlParam['tid']) && $this->UrlParam['tid']>0){
			$this->UrlParam=$this->ConModel->getSortinfo($this->UrlParam['tid']);
			$this->assign('content',$this->UrlParam);
		}
		
    }
    public function index()
    {
		return $this->fetch();
    }
	/*** 新闻资讯*/
    public function newslist()
    {
		//$UrlParam=input();
		//$UrlParam['scode']=$UrlParam['tid'];
       // $this->assign('UrlParam',$UrlParam);
		if(!isset($this->UrlParam['scode']) || $this->UrlParam['scode']<=0) $this->error('错误请求');
		//$this->assign('content',$UrlParam);
		//lists($UrlParam, $num=20, $order='id desc');
        return $this->fetch();
    }
	/*** 新闻详情*/
	public function news()
    {
		$id = input('id');
		if(!isset($id) || $id<=0) $this->error('信息不存在');
        $Info = $this->ConModel->getContent($id);
        if(!$Info) $this->error('信息不存在');
        $this->assign('content',$Info);

        $pre =$this->ConModel->getContentPre($Info['scode'],$Info['id']);
        $this->assign('pre',$pre);

		$next =$this->ConModel->getContentNext($Info['scode'],$Info['id']);
        $this->assign('next',$next);
        return $this->fetch();
    }
	/*** 图片列表*/
    public function designerlist()
    {
		//$UrlParam=input();
		//$UrlParam['scode']=$UrlParam['tid'];
       // $this->assign('UrlParam',$UrlParam);
		if(!isset($this->UrlParam['scode']) || $this->UrlParam['scode']<=0) $this->error('错误请求');
		//$this->assign('content',$UrlParam);
        return $this->fetch();
    }
	/*** 设计师详情*/
	public function designer()
    {
		$id = input('id');
		if(!isset($id) || $id<=0) $this->error('信息不存在');
        $Info = $this->ConModel->getContent($id);
        if(!$Info) $this->error('信息不存在');
        $this->assign('content',$Info);

        $pre =$this->ConModel->getContentPre($Info['scode'],$Info['id']);
        $this->assign('pre',$pre);

		$next =$this->ConModel->getContentNext($Info['scode'],$Info['id']);
        $this->assign('next',$next);
       return $this->fetch();
    }


	/*** 图片列表*/
    public function caseslist()
    {

		//$UrlParam=input();
		//$UrlParam['scode']=$UrlParam['tid'];
       // $this->assign('UrlParam',$UrlParam);
		if(!isset($this->UrlParam['scode']) || $this->UrlParam['scode']<=0) $this->error('错误请求');
		//$UrlParam=$this->ConModel->getSortinfo($UrlParam['scode']);
		//$this->assign('content',$UrlParam);	
		//$sortinfo2=getScodeInfo($UrlParam['scode'],'ico'); 
		//$sortinfo=getTopCodeInfo($UrlParam['scode'],'ico');

        return $this->fetch();
    }
	/*** 图片详情*/
	public function cases()
    {
		$id = input('id');
		if(!isset($id) || $id<=0) $this->error('信息不存在');
        $Info = $this->ConModel->getContent($id);
        if(!$Info) $this->error('信息不存在');
        $this->assign('content',$Info);

        $pre =$this->ConModel->getContentPre($Info['scode'],$Info['id']);
        $this->assign('pre',$pre);

		$next =$this->ConModel->getContentNext($Info['scode'],$Info['id']);
        $this->assign('next',$next);
        return $this->fetch();
    }
	/*** 图片详情*/
	public function pinpai()
    {
		$id = input('id');
		if(!isset($id) || $id<=0) $this->error('信息不存在');
        $Info = $this->ConModel->getContent($id);
        if(!$Info) $this->error('信息不存在');
        $this->assign('content',$Info);

        $pre =$this->ConModel->getContentPre($Info['scode'],$Info['id']);
        $this->assign('pre',$pre);

		$next =$this->ConModel->getContentNext($Info['scode'],$Info['id']);
        $this->assign('next',$next);
        return $this->fetch();
    }

	/*** 图片列表*/
    public function pinpailist()
    {

		//$UrlParam=input();
		//$UrlParam['scode']=$UrlParam['tid'];
       // $this->assign('UrlParam',$UrlParam);
		if(!isset($this->UrlParam['scode']) || $this->UrlParam['scode']<=0) $this->error('错误请求');
		//$this->assign('content',$UrlParam);			
        return $this->fetch();
    }
	 /*** 关于*/
    public function about()
    {
		$tid = input('tid');
		if(!isset($tid) || $tid<=0) $this->error('信息不存在');
        $Info = $this->ConModel->getAbout($tid);
        if(!$Info) $this->error('信息不存在');
        $this->assign('content',$Info);
        return $this->fetch();
    }
	/*** 我要装修*/
    public function renovation()
    {
        return $this->fetch();
    }
}